package com.hxd.otc.api;

import com.hxd.otc.base.BaseBean;
import com.hxd.otc.module.my.bean.BaseListBean;
import com.hxd.otc.module.my.bean.ExchangeRecordBean;
import com.hxd.otc.module.my.bean.ExchangeRuleBean;

import java.util.ArrayList;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by lzy on 2018/12/27 0027.
 * description ${兑换业务API}
 */
public interface IExchangeApi {
    /**
     * 获取兑换币种规则信息
     */
    @GET("exchange/coin/rule")
    Observable<BaseBean<ArrayList<ExchangeRuleBean>>> exchangeCoinRule();

    /**
     * 订单列表
     *
     * @param showCount
     * @param currentPage
     */
    @GET("exchange/list")
    Observable<BaseBean<BaseListBean<ExchangeRecordBean>>> exchangeList(@Query("size") String showCount, @Query("current") String currentPage);

    /**
     * 获取兑换汇率
     *
     * @param outSymbol 转出币种名称
     * @param inSymbol  转入币种名称
     */
    @GET("exchange/tax")
    Observable<BaseBean<String>> exchangeTax(@Query("outSymbol") String outSymbol, @Query("inSymbol") String inSymbol);

    /**
     * 兑换
     *
     * @param outSymbol 转出币种ID
     * @param inSymbol  转入币种ID
     * @param outVolume 转出币种数量
     */
    @POST("exchange/pay")
    Observable<BaseBean<ExchangeRecordBean>> exchangePay(@Query("outSymbol") String outSymbol, @Query("inSymbol") String inSymbol,
                                                         @Query("outVolume") String outVolume);

    /**
     * 查询便民订单详情
     *
     * @param orderId
     */
    @GET("exchange/findById")
    Observable<BaseBean<ExchangeRecordBean>> queryOrderDetail(@Query("orderId") String orderId);


}
